home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / xes131.lha / XES / REXX / LoadFile.xdme < prev    next >
Encoding:
Text File  |  1994-12-23  |  967 b   |  43 lines

  1. /* LoadFile.xdme */
  2.  
  3. options results
  4. address 'XDME.1'
  5. 'rxresult $filename'
  6. filename = result
  7.  
  8. if exists(filename) then do
  9.     call open(input,filename,"R")
  10.     type = readch(input,4)
  11.     if type = "XPKF" then do
  12.         call seek(input,8,"B")
  13.         method = readch(input,4)
  14.     end
  15.     else method = "NONE"
  16.     call close(input)
  17. end
  18. else method = "NONE"
  19. F = '(' || filename || ')'
  20.  
  21. if method = "FEAL" | method = "IDEA" then do
  22.     xcom = "execute (copy """ || filename || """ t:temp)"
  23.     xcom
  24.     body = filename "is encrypted." '0A'x || "Please enter password."
  25.     password = rtgetstring(,body,"Password Requester")
  26.     xcom = 'execute (xpack t:temp password "' || password || '")'
  27.     xcom
  28.     newfile 't:temp'
  29.     chfilename F
  30.     xcom = 'settvar password' password
  31.     xcom
  32. end
  33. else newfile F
  34.  
  35. xsrc = filename || ".xsrc"
  36. if exists(xsrc) then source (xsrc)
  37. else call Mode (filename)
  38.  
  39. if method ~= "NONE" then do
  40.     xcom = 'settvar method' method
  41.     xcom
  42. end
  43.